package com.basic.feign;


import com.code.domain.AjaxResult;
import com.shoppingcart.entity.Shoppingcart;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@Component
@FeignClient(name = "mall-shoppingcart-service" ,path = "/mall-shoppingcart-service",url = "localhost:9005")
public interface ShoppingCartFeign {

    /**
     * 根据用户id查询购物车信息
     * @param userId
     * @return
     */
    @GetMapping(value = "/shoppingcart/queryShoppingcartToUserId/{userId}")
    public @ResponseBody AjaxResult queryShoppingcartToUserId(@PathVariable String userId );

    /**
     * 添加购物车
     * @param shoppingcart
     * @return
     */
    @PostMapping(value = "/shoppingcart/saveShoppingcart")
    public @ResponseBody AjaxResult saveShoppingcart(@RequestBody Shoppingcart shoppingcart);

}
